package org.tech4j.springboot.starter.logging.common;

import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.tech4j.logging.common.collector.LogCollector;
import org.tech4j.logging.common.entity.LogDetail;
import org.tech4j.springboot.starter.logging.common.aop.LogAspect;

/**
 * @program: tech4j
 * @description:
 * @author: YuKai Fan
 * @create: 2025/3/6 18:57
 **/
@Configuration
public class LoggingCommonConfiguration {

    @Bean
    @ConditionalOnBean(LogCollector.class)
    public LogAspect logAspect(LogCollector<LogDetail> logCollector) {
        return new LogAspect(logCollector);
    }
}
